package com.rajaev.dtu.tractor.domain.entity;

import com.rajaev.dtu.tractor.infrastructure.annotations.SNotiCollectionField;
import com.rajaev.dtu.tractor.infrastructure.annotations.SNotiFiled;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.List;

/**
 * 485协议实体内容
 */
@Setter
@Getter
public class Protocol485Dto {


    private long tickTime;

    @SNotiFiled(id = "A_XTGS",message = "电池箱体个数")
    private Integer xtgs;

    @SNotiFiled(id="A_DCXTBBH",message = "电池系统版本号")
    private Integer dcxtbbh;

    @SNotiFiled(id="A_DXRJBBH",message = "电池软件版本号")
    private Integer dcrjbbh;

    @SNotiFiled(id = "A_DCYJBBH",message = "电池硬件版本号")
    private Integer dcyjbbh;

    @SNotiFiled(id = "A_DCDTZS",message = "电池单体总数")
    private Integer dcdtzs;


    @SNotiFiled(id = "A_DCWDZS",message = "电池温度总数")
    private Integer dcwdzs;

    /**
     * 电池实时信息-电池系统状态（1:放电，2：待工作,3:充电,4:紧急模式）
     */
    @SNotiFiled(id = "B_DCXTZT",message = "电池系统状态")
    private Integer dcxtzt;

    /**
     * 电池实时信息-软件模式状态（1:默认，2：加热，3:高压上电,4:高压下电,5:快充,6:紧急故障模式,7:低压下电模式,8:慢充）
     */
    @SNotiFiled(id = "B_RJMSZT",message = "电池模式状态")
    private Integer dcmszt;

    /**
     * 电池实时信息-电池加热状态（1：默认，2：加热，3：冷却，4：故障，5：平均温度，6：完成）
     */
    @SNotiFiled(id = "B_DCJRZT",message = "电池加热状态")
    private Integer dcjrzt;


    /**
     * 电池实时信息-电池系统故障代码（1：默认，2：加热，3：冷却，4：故障，5：平均温度，6：完成）
     */
    @SNotiFiled(id = "B_DCXTGZDM",message = "电池系统故障代码")
    private Integer dcxtgzdm;

    @SNotiFiled(id = "B_DCGZDJ",message = "电池故障等级")
    private Integer dcgzdj;

    @SNotiFiled(id = "B_DCGZZS",message = "电池故障总数")
    private Integer dcgzzs;


    @SNotiFiled(id = "B_DCZDY",message = "电池总电压")
    private BigDecimal dczdy;

    @SNotiFiled(id = "B_DCZDL",message = "电池总电流")
    private BigDecimal dczdl;

    @SNotiFiled(id = "B_SOC",message = "电池实时信息-电池SOC电流")
    private BigDecimal soc;

    @SNotiFiled(id = "B_DCZDDTDY",message = "电池最大单体电压")
    private BigDecimal dczddtdy;

    @SNotiFiled(id = "B_DCZDDTDYBH",message = "电池最大单体电压编号")
    private Integer dczddtdybh;

    @SNotiFiled(id = "B_DCZXDTDY",message = "电池最小单体电压")
    private BigDecimal dczxdtdy;


    @SNotiFiled(id = "B_DCZXDTDYBH",message = "电池实时信息-电池最小单体电压编号")
    private Integer dczxdtdybh;

    @SNotiFiled(id = "B_DCYC",message = "电池实时信息-电池单体压差")
    private BigDecimal dcyc;

    @SNotiFiled(id="B_DCPJDTDY",message = "电池实时信息-电池平均单体电压")
    private Integer dcpjdtdy;

    @SNotiFiled(id = "B_DCZDWD",message = "电池实时信息-电池最大温度")
    private Integer dczdwd;

    @SNotiFiled(id = "B_DCZXWD",message = "电池实时信息-电池最小温度")
    private Integer dczxwd;

    @SNotiFiled(id = "B_DCZDWDBH",message = "电池实时信息-电池最大温度编号")
    private Integer dczdwdbh;

    @SNotiFiled(id = "B_DCZXWDBH",message = "电池实时信息-电池实时信息-电池最小温度编号")
    private Integer dczxwdbh;

    @SNotiFiled(id = "B_CSCTXZT",message = "电池实时信息-CSC通讯状态")
    private Integer csctxzt;

    @SNotiFiled(id = "B_ZDJYDZ",message = "电池实时信息-正端绝缘电阻")
    private Integer zdjydz;

    @SNotiFiled(id = "B_FDJYDZ",message = "电池实时信息-负端绝缘电阻")
    private Integer fdjydz;

    @SNotiFiled(id = "B_ZCSJ",message = "电池实时信息-驻车时间")
    private Integer zcsj;

    @SNotiFiled(id = "B_DCJHCS",message = "电池均衡次数")
    private Integer dcjhcs;

    @SNotiFiled(id = "B_DCFDXHCS",message = "电池实时信息-电池放电循环次数")
    private Integer dcfdxhcs;

    @SNotiFiled(id = "B_DCCDXHCS",message = "电池充电循环次数")
    private int dccdxhcs;

    @SNotiFiled(id = "B_DCJRCS",message = "电池加热次数")
    private int dcjrcs;

    @SNotiFiled(id = "B_DCCDJC",message = "电池实时信息-电池充电计次")
    private Integer dccdjc;

    @SNotiFiled(id = "B_DCFDJC",message = "电池实时信息-电池放电计次")
    private Integer dcfdjc;

    @SNotiFiled(id = "B_DCFDDL",message = "电池实时信息-电池放电电量")
    private Integer dcfddl;

    @SNotiFiled(id = "B_DCCDDL",message = "电池实时信息-电池充电电量")
    private Integer dccddl;

    @SNotiFiled(id = "B_DCCDRL",message = "电池实时信息-电池充电容量")
    private BigDecimal dccdrl;

    @SNotiFiled(id = "B_DCFDRL",message = "电池实时信息-电池放电容量")
    private BigDecimal dcfdrl;

    @SNotiFiled(id = "B_DCZDKYFDDL",message = "电池实时信息-电池最大可用放电电流")
    private BigDecimal dczdkyfddl;

    @SNotiFiled(id = "B_DCZDKYCDDL",message = "电池实时信息-电池最大可用充电电流")
    private BigDecimal dczdkycddl;

    @SNotiFiled(id = "C_DTDYGS",message = "单体电压个数")
    private Integer dtdygs;

    @SNotiFiled(id = "C_DCWDGS",message = "电池温度个数")
    private Integer dcwdgs;

    @SNotiCollectionField(idPrefix="C_DTDY",message = "电池电压",type = SNotiCollectionField.Type.VOLTAGE)
    private List<BatteryVoltage> batteryVoltageList;

    @SNotiCollectionField(idPrefix="C_DTWD",message = "电池温度",type = SNotiCollectionField.Type.TEMPERATURE)
    private List<BatteryTemperature> batteryTemperatureList;

    @Getter
    @Setter
    public class BatteryVoltage{

        //单体编号
        private Integer dtbh;

        //单体电压
        private BigDecimal dtdy;
    }

    @Getter
    @Setter
    public class BatteryTemperature{
        // 温度编号
        private Integer wdbh;
        // 电池温度
        private Integer dcwd;
    }
}
